/*
 * @Description: 
 */
/*
 * @Description: 
 */
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";

export default defineConfig({
  base: "./",
  plugins: [vue()],
  resolve: {
    alias: {
      "@": resovePath("src"),
    },
  },
  css: {
    preprocessorOptions: {
      scss: {
        // additionalData: `@import "./src/plugins/klComponent/assets/css/constant.scss";`,
      },
    },
  },
  // 配置前端服务地址和端口
  server: {
    host: '0.0.0.0',
    port: 3000,
    // 是否开启 https
    https: false,
    proxy: {
      "/mapi": {
        target: "http://www.lingchen.kim:8888",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ""),
      },
    },
  },
  // base: '/demo/'
});

function resovePath(paths) {
  return path.resolve(__dirname, paths);
}

